# 进入服务器目录并启动服务器
$serverJob = Start-Job -ScriptBlock {
    Set-Location "D:\daima\project12\metaverse-pet-adventure-server"
    npm run dev
}

Write-Host "server..." -ForegroundColor Green

# 等待几秒钟让服务器完全启动
Start-Sleep -Seconds 3

# 进入客户端目录并启动开发服务器
Set-Location "D:\daima\project12\metaverse-pet-adventure-client"
Write-Host "client..." -ForegroundColor Green
npm run dev

# 当客户端停止时，停止服务器
Stop-Job -Job $serverJob
Remove-Job -Job $serverJob
